<template>
  <el-dialog title="添加人员" width="550px" :visible.sync="dialogFormVisible">
    <el-form :model="form">
      <el-form-item label="姓名：" :label-width="formLabelWidth">
        <el-input v-model="form.name" size="medium" class="item-row" placeholder="请输入" />
      </el-form-item>
      <el-form-item label="性别：" :label-width="formLabelWidth">
        <el-select v-model="form.sex" size="medium" class="item-row" clearable placeholder="请选择">
          <el-option label="男" value="1"></el-option>
          <el-option label="女" value="0"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="所属组织：" :label-width="formLabelWidth">
        <el-select v-model="form.organize" size="medium" class="item-row" clearable placeholder="请选择">
          <el-option v-for="item in organizations" :key="item.depId" :label="item.depName" :value="item.depId" />
        </el-select>
      </el-form-item>
      <el-form-item label="证件号码：" :label-width="formLabelWidth">
        <el-input v-model="form.IDNumber" size="medium" class="item-row" placeholder="请输入" maxlength="18" />
      </el-form-item>
      <el-form-item label="工号：" :label-width="formLabelWidth">
        <el-input v-model="form.jobNumber" size="medium" class="item-row" placeholder="请输入" />
      </el-form-item>
      <el-form-item label="手机号码：" :label-width="formLabelWidth">
        <el-input v-model="form.tel" size="medium" class="item-row" placeholder="请输入" maxlength="11" />
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogFormVisible = false">取 消</el-button>
      <el-button type="primary" @click="submitFormInfo">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
import httpInterface from "../../../../util/httpInterface";
import { mapState } from "vuex";

export default {
  name: "AddStaffInfo",
  components: {},
  data() {
    return {
      dialogFormVisible: false,
      formLabelWidth: "84px",
      form: {
        name: "",
        sex: "1",
        organize: "",
        IDNumber: "",
        jobNumber: "",
        tel: ""
      },
    }
  },

  computed: {
    ...mapState(["organizations"])
  },

  created() {},

  mounted() {

  },

  methods: {
    submitFormInfo() {
      let _this = this;
      let params = this.form;
      // this.dialogFormVisible = false;
    },

    show() {
      this.dialogFormVisible = true;
      this.form = {
        name: "",
        sex: "1",
        organize: "",
        IDNumber: "",
        jobNumber: "",
        tel: ""
      };
    }
  }
}
</script>

<style scoped lang="scss">
  .item-row{
    width: 240px;
  }

  .el-select >>> .el-input__icon {
    line-height: inherit;
  }

  .el-form{
    display: flex;
    flex-direction: column;
    align-items: center;

    .el-form-item {
      margin: 7px 0 !important;
    }
  }
</style>
